package com.zlj.springcloud.service.impl;

import com.zlj.springcloud.entity.Dept;
import com.zlj.springcloud.mapper.DeptMapper;
import com.zlj.springcloud.service.DeptService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: java类作用描述
 * @Author: zlj
 * @CreateDate: 2018/6/13 15:21
 * @Version: 1.0.0
 */
@Service
public class DeptServiceImpl implements DeptService {

    private final DeptMapper deptMapper;

    public DeptServiceImpl(DeptMapper deptMapper) {
        this.deptMapper = deptMapper;
    }

    @Override
    public boolean add(Dept dept) {
        return deptMapper.addDept(dept);
    }

    @Override
    public Dept get(Long deptNo) {
        return deptMapper.findById(deptNo);
    }

    @Override
    public List<Dept> list() {
        return deptMapper.findAll();
    }
}
